<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
      onload=function () {
        let elementById = document.getElementById("b");
        elementById.onclick=function () {
          history.go(-1);
        }
      }
    </script>
</head>
<body>
      <h1><a href="test2.html">B界面</a></h1>
      <input type="button" value="后退" id="b">
</body>
</html>